﻿<Window x:Class="WpfWordsLearner.Views.TranslateWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ext="http://schemas.xceed.com/wpf/xaml/toolkit"
        Title="Translate"
        Width="500"
        Height="250"
        WindowStyle="ToolWindow">
	<DockPanel>
		<Menu DockPanel.Dock="Top">
			<MenuItem Header="File">
				<MenuItem Command="{Binding FileTranslaion}" Header="Translate from file" />
				<Separator />
				<MenuItem Command="{Binding CloseWindow}" Header="Close" />
			</MenuItem>
		</Menu>
		<Grid FocusManager.FocusedElement="{Binding ElementName=txtOriginal}">
			<Grid.RowDefinitions>
				<RowDefinition Height="30" />
				<RowDefinition />
			</Grid.RowDefinitions>
			<Grid.ColumnDefinitions>
				<ColumnDefinition />
				<ColumnDefinition />
			</Grid.ColumnDefinitions>
			<StackPanel Grid.ColumnSpan="2"
			            HorizontalAlignment="Stretch"
			            Orientation="Horizontal">
				<TextBlock Margin="3,0,0,0"
				           VerticalAlignment="Center"
				           Text="From language" />
				<ComboBox x:Name="cmbFrom"
				          Width="40"
				          Margin="3,0,0,0"
				          ItemsSource="{Binding FromLanguage}"
				          SelectedIndex="0"
				          SelectedItem="{Binding Path=Request.FromLanguage}" />
				<TextBlock Margin="3,0,0,0"
				           VerticalAlignment="Center"
				           Text="To language" />
				<ComboBox x:Name="cmbTo"
				          Width="40"
				          Margin="3,0,0,0"
				          ItemsSource="{Binding ToLanguage}"
				          SelectedIndex="0"
				          SelectedItem="{Binding Path=Request.ToLanguage}" />
				<Button Width="60"
				        Margin="5,0,0,0"
				        Command="{Binding Translate}"
				        Content="Translate" />
				<Button Width="110"
				        Margin="5,0,0,0"
				        Command="{Binding Save}"
				        Content="Save to dictionary" />
			</StackPanel>
			<TextBox x:Name="txtOriginal"
			         Grid.Row="1"
			         AcceptsReturn="True"
			         AcceptsTab="True"
			         Text="{Binding Path=Request.Content,
			                        Mode=TwoWay}" />
			<TextBox Grid.Row="1"
			         Grid.Column="1"
			         AcceptsReturn="True"
			         AcceptsTab="True"
			         IsReadOnly="True"
			         Text="{Binding Path=Result}" />
			<ext:BusyIndicator x:Name="busyInd"
			                   Grid.RowSpan="2"
			                   Grid.ColumnSpan="2"
			                   BusyContent="Wait while translating..."
			                   IsBusy="{Binding NeedBusy}" />
		</Grid>
	</DockPanel>
</Window>
